package com.qf;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * 启动类
 */
@SpringBootApplication
@EnableEurekaClient
//开启远程调用 feign功能 并指定feign所在包
@EnableFeignClients(basePackages = {"com.qf.feign"})
//开启断路器
@EnableCircuitBreaker
//扫描过滤器所在包
@ServletComponentScan("com.qf.filter")
public class CustomerApplication {

    public static void main(String[] args) {
        SpringApplication.run(CustomerApplication.class,args);
    }


    /**
     * 创建对象 放入Spring的容器
     */
    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }


}